/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//		File Name		:		CGamePlayState.h
//
//		Author			:		Kevin Jordan
//
//		Purpose			:		A header for all functions and members of the Game Play State
//
//		Dates			:		Written( Feb 12, 2011 ) by Kevin Jordan		LastUpdate( Feb 17, 2011  ) by Kevin Jordan 
//	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#ifndef GAMEPLAY_STATE_H_
#define GAMEPLAY_STATE_H_

#include "IBaseState.h"
#include "CPlayer.h"
#include "Cenemy.h"
#include "CBaseObject.h"
#include "CPlayerProfile.h"
#include "Ilistener.h"
#include "CEmitter.h"


class CGamePlayState : public IBaseState, public IListener
{

private:

	CGamePlayState();
	~CGamePlayState();
	CGamePlayState(const CGamePlayState& copy);
	CGamePlayState& operator=(const CGamePlayState& assign);

	bool IsInGame;

	CPlayer* pPlayer;
	CBaseEnemy* pEnemy;
	CBaseObject* pLight;
	CEmitter* pEmitter;

	//Level control point
	IBaseState* pLevelState;

	CPlayerProfile ActiveProfile;


	int ImageID;
	int HUDID;
	int LightPoleImage;
	int PlayerImage;
	int PauseID;

	int m_nPauseSelection;

	bool SaveBeforeExit;
	bool m_bWinGame, m_bGameOver, m_bTriggedEvent, m_bGamePaused;

	float fBucketTE;
	int score;

public:

	//Singleton Accessor
	static CGamePlayState* GetInstance();

	//Neccessary Class member functions to Instnatiate
	void Enter();
	bool Input();
	void Update(float fElapsedTime);
	void Render();
	void Exit();

	void UpdatePlayerProfile();

	bool GetGameStatus()	{return IsInGame;}

	CPlayer* GetPlayer()	{ return pPlayer; }
	bool GetTrigger()		{ return m_bTriggedEvent; }
	void SetTrigger( bool newTriggerStatus )		{ m_bTriggedEvent = newTriggerStatus; }
	IBaseState* GetLevel()	{	return pLevelState; }

	void WinGame(bool yah){m_bWinGame = yah;}
	void GameOver(bool yah){m_bGameOver = yah;}
	bool GetWin() {return m_bWinGame;}
	bool GetLose(){return m_bGameOver;}
	bool GetPause()	{return m_bGamePaused;}

	void SetPause(bool yah)	{	m_bGamePaused = yah; }	

	void HandleEvent(CEvent* pEvent);
	bool GetTrigEvent()		{return m_bTriggedEvent;}
	int CalculateScore(int wave, int money, int timer, int rage, int health);

	void RenderHUD();
};
#endif